<template>
  <div>
      <el-container>
        <el-header>
          <h2 style="text-align: center">Lovo商城供应商系统注册失败原因</h2>
        </el-header>
        <el-main>
          <el-alert
              title="温馨提示：最新注册失败原因在最后一条"
              type="warning"
              :closable="false">
          </el-alert>
          <el-table :data="tableData" style="width: 100%;height: 350px">
            <el-table-column prop="id" label="编号" />
            <el-table-column prop="reason" label="原因" />
          </el-table>

          <div style="display:flex; justify-content: center">
            <el-button type="success" @click="$router.push({path:'/register',query: {status:true}})">
              重新注册
            </el-button>
            <el-button type="primary" @click="exitLogin">
              返回
            </el-button>
          </div>
        </el-main>
      </el-container>
  </div>
</template>

<script>
import axios from "axios";

export default {
  data() {
    return {
      tableData:[]
    }
  },
  methods:{
    findErr(){
      axios.get("/project/supplier/findErr").then(resp=>{
        if (resp.data.success){
          this.tableData=resp.data.data
        }
      })
    },
    exitLogin(){
      sessionStorage.removeItem("token");
      this.$router.push("/")
    }
  },
  created() {
    this.findErr()
  }
}
</script>

<style scoped>

</style>